<admintpl file="header"/>
</head>
<body>
<div class="wrap">
    <form method="post" class="form-horizontal " id="myform"  action="{:U('Admin/Message/editmember')}">
        <div class="control-group">
            <div class="span3">

                <input type="hidden" name="id" id="id" value="{$id}">
                <tr id="set_view_tr">
                    <td>观众数</td>
                    <td>
                        <input type="text" name="set_view_count" id='set_view' value="{$set_view_count}" placeholder="0">
                    </td>
                </tr>
                <tr id="set_mes_tr">
                    <td>留言数</td>
                    <td>
                        <input type="text" name="set_mes_count" id='set_mes' value="{$set_mes_count}" placeholder="0">
                    </td>
                </tr>
            </div>
        </div>

        <div class="form-actions" style="padding-left:260px; margin-top: 50px;">
            <a class="btn btn-primary" id="ajaxform">提 交</a>
            &nbsp;&nbsp;<a class="btn" id="ajaxback">{:L('BACK')}</a>
        </div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript"
        src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
    // ajax 提交表单
    $(document).ready(function(){
        $("#ajaxform").click(function(){    // 提交按钮触发事件
            var tourl = $("#myform").attr("action");    // 获取 表单的 提交地址
            var id       = $("#id").val();
            var set_view = $("#set_view").val();
            var set_mes  = $("#set_mes").val();
            var edit     = 1;
            $.post(tourl,{id:id,set_view_count:set_view,set_mes_count:set_mes,edit:edit},function(result){
                if(result == '1'){
                    var msg = '编辑成功';
                }else{
                    var msg = '编辑失败';
                }

                parent.layer.msg(msg,{time:2000},1,function(a){

                });
                setTimeout(function(){
                    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index);
                }, 1000);
            });
        });
        $("#ajaxback").click(function(){
            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
            parent.layer.close(index);
        });
    });
</script>
</body>
</html>